<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
    <link rel="stylesheet" type="text/css" th:href="@{{path}/common/v3/summernote/summernote-bs3.css?v={v}((path=${staticPath},v=${v})}">
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInLeft">
        <div data-th-replace="common/functionDepict"></div>
        <div>
            <div class="row">
                <div class="pt10">
                    <div class="col-sm-9">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>填写基本信息</h5>
                            </div>
                            <div class="ibox-content clearfix pt10">
                                <form class="form-horizontal m-t" id="commentForm">
                                    <input type="hidden" name="id" th:value="${article['id']}"/>
                                    <div class="form-horizontal">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 资讯名称</label>
                                            <div class="col-sm-8">
                                                <input class="validate-data form-control" type="text" name="title" th:value="${article['title']}"/>
                                                <span class="help-block m-b-none c-999">请填写资讯名称</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 资讯作者</label>
                                            <div class="col-sm-8">
                                                <input class="validate-data form-control" type="text" name="author" th:value="${article['author']}"/>
                                                <span class="help-block m-b-none c-999">请填写资讯作者名称</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 选择资讯类型</label>
                                            <div class="col-sm-8">
                                                <select   name="typeId" id="articleType" style="width: 100%" class="chosen-select">
                                                    <option value="">选择资讯类型</option>
                                                    <option th:if="!${#lists.isEmpty(articleTypeList)}" th:each="articleType : ${articleTypeList}" th:value="${articleType['id']}" th:text="${articleType['typeName']}" th:selected="${articleType['id']} == ${article['typeId']}"></option>
                                                </select>
                                                <span class="help-block m-b-none c-999" > 请选择资讯类型</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 资讯关键字</label>
                                            <div class="col-sm-8">
                                                <input class="validate-data form-control" type="text" name="keyWord" th:value="${article['keyWord']}"/>
                                                <span class="help-block m-b-none c-999">请填写资讯关键字（最多为12个字符）</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 资讯点击量</label>
                                            <div class="col-sm-8">
                                                <input class="validate-data form-control" type="text" name="clickNum" th:value="${article['clickNum']}"/>
                                                <span class="help-block m-b-none c-999">请填写资讯资讯点击量</span>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 上传封面</label>
                                            <div class="col-sm-8">
                                                <p>
                                                    <button class="btn btn-primary " id="articleImageBtn" type="button"><i class="fa fa-image"></i>&nbsp;选择资讯封面</button>
                                                    <span class="ml10">
                                                        <small class="fs12 c-red">
                                                            <i class="fa fa-lightbulb-o"></i> 上传资讯封面
                                                            &nbsp;&nbsp;&nbsp;*&nbsp;建议最大尺寸(宽*高 px)：580*334&nbsp;&nbsp;或者比例:&nbsp;16:9
                                                        </small>
                                                    </span>
                                                </p>
                                                <div class="clearfix">
                                                    <div class="file-box">
                                                        <div class="file">
                                                            <span class="corner" title="删除" id="remove-image"><i class="fa fa-remove"></i></span>
                                                            <div class="image">
                                                                <input type="hidden" id="imageJson" name="imageJson" th:value="${article['imageJson']}"/>
                                                                <img alt="image" id="article-image" class="img-responsive" th:src="!${#maps.isEmpty(article['imageMap'])} ? ${article['imageMap']['pcUrlMap']['large']} : @{{path}/admin/v3/img/default/default-pic.jpg?v={v}(path=${staticPath},v=${v})}">
                                                            </div>
                                                            <div class="file-name">
                                                                <p id="file-names" th:text="!${#maps.isEmpty(article['imageMap'])} and ${article['imageMap']['fileName']}!=null ? ${article['imageMap']['fileName']}:'文件名'"></p>
                                                                <small id="create-time" th:text="!${#maps.isEmpty(article['imageMap'])} and ${article['imageMap']['createTime']}!=null ?'上传时间：' + ${article['imageMap']['createTime']}:'上传时间'"></small>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"> <i class="c-red">*</i> 资讯简介</label>
                                            <div class="col-sm-10">
                                                <textarea id="article-briefIntroduction" class="form-control" name="briefIntroduction" th:text="${article['briefIntroduction']}" ></textarea>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label text-right"> <i class="c-red">*</i> 资讯内容</label>
                                            <div class="col-sm-10">
                                                <textarea th:if="not ${#maps.isEmpty(article)}" id="article-articleContext" name="context" class="hide" th:text="${article['articleContext']['context']}"></textarea>
                                                <textarea th:if="${#maps.isEmpty(article)}" id="article-articleContext" name="context" class="hide"></textarea>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <div class="col-sm-8 col-sm-offset-2">
                                                <button id="save" class="btn btn-primary ml10" type="button">保存</button>
                                                <button id="saveRelease" class="btn btn-primary ml10"  type="button">保存、发布</button>
                                                <button id="cancel" class="btn btn-primary ml10" type="button">取消</button>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <div data-th-replace="common/importantNotes"></div>
                </div>
            </div>
        </div>
    </div>
    <div data-th-replace="layout/head-footer"></div>
    <script type="text/javascript" th:src="@{{path}/common/summernote/summernote.min.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/common/summernote/summernote-zh-CN.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/business/upload/common-webuploader.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/business/op/article/article-save.js?v={v}(path=${staticPath},v=${v})}"></script>
</body>
</html>
